﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace EZCRS.BackOffice.Common.Configuration
{
    public class Hubs1InterfaceSection : ConfigurationSection
    {
        [ConfigurationProperty("IBOFactory")]
        public InterfaceElement IBOFactory
        {
            get { return this["IBOFactory"] as InterfaceElement; }
            set { this["IBOFactory"] = value; }
        }

        [ConfigurationProperty("IDAOFactory")]
        public InterfaceElement IDAOFactory
        {
            get { return this["IDAOFactory"] as InterfaceElement; }
            set { this["IDAOFactory"] = value; }
        }

        public static Hubs1InterfaceSection Instance
        {
            get
            {
                return ConfigurationManager.GetSection("Hubs1Interface") as Hubs1InterfaceSection;
            }
        }

        public InterfaceElement GetFactoryType(string typeName)
        {
            return this.GetType().GetProperty(typeName).GetValue(this, null) as InterfaceElement;
        }
    }
}
